<template>
	<view class="main">
		<view class="box">
			<uni-easyinput autoHeight v-model="value"  type="textarea" :placeholder="$t('mine.feedbackPlaceholder')"></uni-easyinput>
		</view>
		<view class="btn" @click="submit">
			{{$t('index.submit')}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value:"",
			};
		},
		onLoad(options){

		},
		methods:{
			submit(){
				if(this.value == ""){
					uni.showToast({
						title:"请输入内容",
						icon:"none"
					})
					return
				}
				let token = JSON.parse(uni.getStorageSync('token')).token
				this.$httpRequest({
					url:"app/api/appfeedback.php",
					method:"POST",
					data:{
						ustoken:token,
						content:this.value
					}
				}).then(res=>{
					if(res.errorcode == 200){
						uni.showToast({
							title:"提交成功",
							icon:"success"
						})
						this.value = ""
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.main{
	width: 100%;
	margin: 20rpx auto;
	.box{
		width: 90%;
		margin: 20rpx auto 0;
		::v-deep .uni-easyinput__content{
			border: none;
		}
		.name{
			display: flex;
			justify-content: space-around;
			align-items: center;
			text{
				margin-right: 10rpx;
			}
			.ipt{
				flex: 1;
			}
		}
	}
	.btn {
		width: 90%;
		margin: 48rpx auto 0;
		text-align: center;
		line-height: 94rpx;
		color: #FFFFFF;
		font-size: 32rpx;
		font-weight: 500;
		border-radius: 144rpx;
		background: #4DBEC1;
	}
}
</style>
